package com.lyp.mvpsupermanage.network;

import com.lyp.mvpsupermanage.network.bean.LoginBean;
import com.lyp.mvpsupermanage.network.bean.MainModel;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import rx.Observable;

/**
 * 作者:ChenXi 时间:2017/7/27 15: 51
 */
//接口
public interface ApiStores {

    String API_SERVER_URL = "http://www.weather.com.cn/";
    String API_URL = "http://www.91yangxixi.com/api/index.php/api/manage/";

    //加载天气
    @GET("adat/sk/{cityId}.html")
    Call<MainModel> loadDataByRetrofit(@Path("cityId") String cityId);

    //加载天气
    @GET("adat/sk/{cityId}.html")
    Observable<MainModel> loadDataByRetrofitRxjava(@Path("cityId") String cityId);


    //登录
    @FormUrlEncoded
    @POST("login")
    Observable<LoginBean> getLogin(
            @Field("user") String user,
            @Field("pwd") String pwd);

    //登录
    @FormUrlEncoded
    @POST("login")
    Call<LoginBean> Login(
            @Field("user") String user,
            @Field("pwd") String pwd);
}
